package com.coincalf.dto;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Description: 持仓汇总
 * @Author: Chen Long
 * @Date: Created in 2018/5/31 下午6:05
 * @Modified by: Chen Long
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class PositionSummaryDTO implements Comparable<PositionSummaryDTO> {

    /**
     * 市场ID
     */
    private Long marketId;

    /**
     * 市场名称（品种）
     */
    private String marketName;

    /**
     * 委托类型
     */
    private Integer type;

    /**
     * 委托数量
     */
    private BigDecimal volume;

    /**
     * 持仓均价
     */
    private BigDecimal avgPrice;

    /**
     * 持仓盈亏
     */
    private BigDecimal profit;

    /**
     * 手续费
     */
    private BigDecimal fee;

    /**
     * 现价
     */
    private BigDecimal currentPrice;

    /**
     * 开仓时间
     */
    private Date openTime;

    @Override
    public int compareTo(PositionSummaryDTO positionSummary) {
        return this.openTime.compareTo(positionSummary.openTime);
    }
}
